<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>回复内容</title>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>
<div style="margin: 20px">
<div class="layui-form-item layui-form-text">
    <form class="layui-form layui-form-pane">
        <div class="layui-form-item layui-form-text">

            <label class="layui-form-label">回复内容</label>
            <div class="layui-input-block">
                <input type="hidden" id="id" name="id" th:value="${c.id}">
                <textarea placeholder="请输入内容"  name="reply" class="layui-textarea" style="height: 300px"></textarea>
            </div>
        </div>

        <div class="layui-form-item " style="display: none">
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit="" lay-filter="submitBtn" id="submitBtn"></a>
            </div>
        </div>
    </form>
</div>
</div>
<script>
    var $;
  layui.use(['form','jquery'],function () {
      var form=layui.form;
      $=layui.jquery;
      form.on('submit(submitBtn)',function (data) {
          var formData=data.field;
          $.ajax({
              type:'post',
              url:'/system/ccc/update',
              data:formData,
              dataType:'json',
              success:function (result) {
                  layer.msg(result.msg);
                  if(result.is){
                      let index =parent.layer.getFrameIndex(window.name)
                      parent.layer.close(index);//关闭父窗口
                  }
              }
          })
      })

  })
    function btnSubmit() {
        $('#submitBtn').click()
    }
</script>
</body>
</html>